package com.ruoyi.web.controller.fenxi;

import com.ruoyi.web.controller.fenxi.response.R;
import com.ruoyi.web.controller.fenxi.utils.ImportUtil;
import com.ruoyi.web.controller.fenxi.utils.QueueModel;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/system")
public class ImportMoneyProgressController {
    @GetMapping(path = {"/progress/getProgress","/data/progress/getProgress"})
    @ResponseBody
    public R getProgress(@RequestParam String code) {
        QueueModel queueModel = ImportUtil.getInstance().getQueueModel(code);
        if(queueModel == null) {
            return R.ok().put("queueModel", new QueueModel());
        }
        return R.ok().put("queueModel", queueModel);
    }
}